package android.demo.service.binder;

import android.content.Intent;
import android.demo.service.BaseService;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class LocalService extends BaseService {

	private final IBinder localBinder = new LocalBinder();
	
	@Override
	public IBinder onBind(Intent intent) {
		Log.i(TAG, this + "....................onBind");
		Log.i(TAG, "Pid: " + android.os.Process.myPid());
		Log.i(TAG, "Tid: " + android.os.Process.myTid());
		return localBinder;
	}
	
    public class LocalBinder extends Binder {
    	public LocalService getService() {            
    		return LocalService.this;       
    	}    
	}
    
    public String testMethod() {
    	Log.i(TAG, "testMethod process."); 
    	return "I'm LocalService.";
    }
}
